#include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
using namespace std;
const int N = 2e6 + 10;
int main()
{
	cin.tie(0); 
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	string a;
	cin >> a;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		string t = a.substr(0, i);
		string b = a.substr(i, n);
		b += t;
		if (b == a) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}